namespace Backoffice.Domain.Entities.App;

/// <summary>
/// 用户角色关联表
/// </summary>
/// 
/// 
public class AppRolePermission : EntityBase
{
    public Guid RoleId { get; private set; } // 角色ID
    public Guid PermissionId { get; private set; } // 权限ID

    // 导航属性
    public virtual AppRole Role { get; private set; } = null!;
    public virtual AppPermission Permission { get; private set; } = null!;

    private AppRolePermission() { }

    public AppRolePermission(AppRole role, AppPermission permission)
    {
        Role = role;
        Permission = permission;
        RoleId = role.Id;
        PermissionId = permission.Id;
    }
}